package com.caifu.mapper;

import com.caifu.pojo.YlFloor;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author GZ
 * @since 2020-11-05
 */
public interface YlFloorMapper extends BaseMapper<YlFloor> {
    /**
    * 
    * 功能描述：查询楼苑下的总楼层数
     *
     * buildingNo 楼苑编号
    *
    * @Author  GZ
    * @Date   2020/11/6 9:33
    */
    @Select({"<script>",
            "select count(*) from yl_floor where FLOOR_STATE=1",
            "and BUILDING_NO =#{buildingNo}",
    "</script>"})
    int queryTotalFloorCounts(@Param("buildingNo") String buildingNo);
    /**
    * 
    * 功能描述：根据楼层名称查询楼层信息
    * 
    * @Param floorName 楼层名称  buildingNo 楼苑编号
    * @Return      
    * @Exception   
    * @Author  GZ
    * @Date   2020/11/6 9:34
    */
    @Select({"<script>",
            "select * from yl_floor where FLOOR_STATE=1",
            "and BUILDING_NO =#{buildingNo}",
            "and FLOOR_NAME=#{floorName}",
            "</script>"})
    YlFloor queryFloorInfoByFloorName(@Param("floorName") String floorName
            ,@Param("buildingNo") String buildingNo);
}
